.class public Lcom/instagram/android/InstagramApplication;
.super Landroid/app/Application;
.source "InstagramApplication.java"


# static fields
.field private static final a:Lch/boye/httpclientandroidlib/Header;

.field private static final b:Lcom/instagram/f/b/h;


# instance fields
.field private final c:Lcom/instagram/android/m/a;

.field private final d:Lcom/instagram/android/service/b;

.field private final e:Lcom/instagram/android/service/r;

.field private f:Landroid/content/BroadcastReceiver;

.field private g:Lcom/facebook/a/f;


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    .line 72
    new-instance v0, Lch/boye/httpclientandroidlib/message/BasicHeader;

    const-string v1, "Referer"

    const-string v2, "android.instagram.com"

    invoke-direct {v0, v1, v2}, Lch/boye/httpclientandroidlib/message/BasicHeader;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    sput-object v0, Lcom/instagram/android/InstagramApplication;->a:Lch/boye/httpclientandroidlib/Header;

    .line 74
    new-instance v0, Lcom/instagram/android/a;

    invoke-direct {v0}, Lcom/instagram/android/a;-><init>()V

    sput-object v0, Lcom/instagram/android/InstagramApplication;->b:Lcom/instagram/f/b/h;

    return-void
.end method

.method public constructor <init>()V
    .locals 1

    .prologue
    .line 63
    invoke-direct {p0}, Landroid/app/Application;-><init>()V

    .line 83
    new-instance v0, Lcom/instagram/android/m/a;

    invoke-direct {v0}, Lcom/instagram/android/m/a;-><init>()V

    iput-object v0, p0, Lcom/instagram/android/InstagramApplication;->c:Lcom/instagram/android/m/a;

    .line 85
    new-instance v0, Lcom/instagram/android/service/b;

    invoke-direct {v0}, Lcom/instagram/android/service/b;-><init>()V

    iput-object v0, p0, Lcom/instagram/android/InstagramApplication;->d:Lcom/instagram/android/service/b;

    .line 89
    new-instance v0, Lcom/instagram/android/service/r;

    invoke-direct {v0}, Lcom/instagram/android/service/r;-><init>()V

    iput-object v0, p0, Lcom/instagram/android/InstagramApplication;->e:Lcom/instagram/android/service/r;

    .line 93
    new-instance v0, Lcom/instagram/android/b;

    invoke-direct {v0, p0}, Lcom/instagram/android/b;-><init>(Lcom/instagram/android/InstagramApplication;)V

    iput-object v0, p0, Lcom/instagram/android/InstagramApplication;->f:Landroid/content/BroadcastReceiver;

    .line 121
    new-instance v0, Lcom/instagram/android/c;

    invoke-direct {v0, p0}, Lcom/instagram/android/c;-><init>(Lcom/instagram/android/InstagramApplication;)V

    iput-object v0, p0, Lcom/instagram/android/InstagramApplication;->g:Lcom/facebook/a/f;

    return-void
.end method

.method static synthetic a(Lcom/instagram/android/InstagramApplication;)Lcom/instagram/android/service/b;
    .locals 1
    .parameter

    .prologue
    .line 63
    iget-object v0, p0, Lcom/instagram/android/InstagramApplication;->d:Lcom/instagram/android/service/b;

    return-object v0
.end method

.method static synthetic b()Lch/boye/httpclientandroidlib/Header;
    .locals 1

    .prologue
    .line 63
    sget-object v0, Lcom/instagram/android/InstagramApplication;->a:Lch/boye/httpclientandroidlib/Header;

    return-object v0
.end method

.method static synthetic b(Lcom/instagram/android/InstagramApplication;)Lcom/instagram/android/service/r;
    .locals 1
    .parameter

    .prologue
    .line 63
    iget-object v0, p0, Lcom/instagram/android/InstagramApplication;->e:Lcom/instagram/android/service/r;

    return-object v0
.end method

.method private c()V
    .locals 9

    .prologue
    .line 214
    invoke-static {}, Lcom/instagram/strings/StringBridge;->a()Z

    move-result v0

    if-nez v0, :cond_0

    .line 215
    invoke-static {p0}, Lcom/instagram/i/a;->c(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v3

    .line 216
    invoke-static {p0}, Lcom/instagram/i/a;->b(Landroid/content/Context;)I

    move-result v0

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    .line 217
    invoke-static {p0}, Lcom/instagram/android/util/b;->b(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v2

    .line 218
    const-string v0, "f1375c5c89df44469017501f648cea4e"

    invoke-static {v0}, Lcom/instagram/strings/StringBridge;->getInstagramString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 219
    const-string v0, "a8c6c2a9ccc8461a82c40ab32bdd0db5"

    invoke-static {v0}, Lcom/instagram/strings/StringBridge;->getInstagramString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    .line 220
    invoke-static {}, Lcom/instagram/service/a;->a()Lcom/instagram/service/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/service/a;->c()Ljava/lang/String;

    move-result-object v7

    .line 221
    invoke-static {}, Lcom/instagram/android/g/b;->e()Ljava/lang/String;

    move-result-object v8

    .line 223
    new-instance v0, Lcom/instagram/android/b/h;

    move-object v1, p0

    invoke-direct/range {v0 .. v8}, Lcom/instagram/android/b/h;-><init>(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    invoke-static {v0}, Lcom/instagram/b/a;->a(Lcom/instagram/b/c;)V

    .line 227
    :cond_0
    invoke-static {}, Lcom/facebook/c/h/b;->b()Lcom/facebook/c/h/b;

    move-result-object v0

    .line 228
    new-instance v1, Lcom/instagram/android/b/t;

    invoke-static {}, Lcom/instagram/b/a;->a()Lcom/instagram/b/c;

    move-result-object v2

    invoke-direct {v1, v2, v0}, Lcom/instagram/android/b/t;-><init>(Lcom/instagram/b/c;Lcom/facebook/c/h/a;)V

    invoke-static {v1}, Lcom/instagram/b/a;->a(Lcom/instagram/b/g;)V

    .line 230
    return-void
.end method

.method static synthetic c(Lcom/instagram/android/InstagramApplication;)V
    .locals 0
    .parameter

    .prologue
    .line 63
    invoke-direct {p0}, Lcom/instagram/android/InstagramApplication;->e()V

    return-void
.end method

.method private d()V
    .locals 4

    .prologue
    .line 233
    invoke-static {}, Lcom/instagram/android/p/f;->a()Lcom/instagram/android/p/f;

    move-result-object v0

    invoke-virtual {p0}, Lcom/instagram/android/InstagramApplication;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    new-instance v2, Lcom/facebook/b/a/k;

    invoke-direct {v2, p0}, Lcom/facebook/b/a/k;-><init>(Landroid/content/Context;)V

    new-instance v3, Lcom/instagram/android/p/a;

    invoke-direct {v3, p0}, Lcom/instagram/android/p/a;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0, v1, v2, v3}, Lcom/instagram/android/p/f;->a(Landroid/content/Context;Lcom/facebook/b/a/k;Lcom/instagram/android/p/a;)V

    .line 238
    return-void
.end method

.method private e()V
    .locals 2

    .prologue
    .line 241
    invoke-static {}, Lcom/instagram/android/g/b;->a()Lcom/facebook/a/b;

    move-result-object v0

    .line 242
    invoke-virtual {v0}, Lcom/facebook/a/b;->a()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 244
    iget-object v1, p0, Lcom/instagram/android/InstagramApplication;->g:Lcom/facebook/a/f;

    invoke-virtual {v0, p0, v1}, Lcom/facebook/a/b;->a(Landroid/content/Context;Lcom/facebook/a/f;)Z

    .line 248
    :goto_0
    invoke-static {p0}, Lcom/instagram/android/g/b;->a(Landroid/content/Context;)V

    .line 249
    return-void

    .line 246
    :cond_0
    invoke-static {}, Lcom/instagram/android/g/b;->f()V

    goto :goto_0
.end method

.method private f()V
    .locals 2

    .prologue
    .line 252
    invoke-virtual {p0}, Lcom/instagram/android/InstagramApplication;->getCacheDir()Ljava/io/File;

    move-result-object v0

    .line 253
    if-nez v0, :cond_0

    .line 254
    const-string v0, "failed_to_initialize_cache_dir"

    const-string v1, "failed_to_initialize_cache_dir"

    invoke-static {v0, v1}, Lcom/instagram/g/c;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 257
    :cond_0
    return-void
.end method

.method private g()V
    .locals 7

    .prologue
    const/16 v5, 0xe

    const/4 v0, 0x1

    const/4 v1, 0x0

    .line 267
    const-string v2, "InstagramApplication"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Device model: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    sget-object v4, Landroid/os/Build;->MODEL:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 269
    const/16 v2, 0x14

    new-array v3, v2, [Ljava/lang/String;

    const-string v2, "Galaxy Nexus"

    aput-object v2, v3, v1

    const-string v2, "Nexus S"

    aput-object v2, v3, v0

    const/4 v2, 0x2

    const-string v4, "HTC_Amaze_4G"

    aput-object v4, v3, v2

    const/4 v2, 0x3

    const-string v4, "DROID3"

    aput-object v4, v3, v2

    const/4 v2, 0x4

    const-string v4, "DROID4"

    aput-object v4, v3, v2

    const/4 v2, 0x5

    const-string v4, "DROIDX"

    aput-object v4, v3, v2

    const/4 v2, 0x6

    const-string v4, "DROID BIONIC"

    aput-object v4, v3, v2

    const/4 v2, 0x7

    const-string v4, "SPH-D700"

    aput-object v4, v3, v2

    const/16 v2, 0x8

    const-string v4, "GT-I9100"

    aput-object v4, v3, v2

    const/16 v2, 0x9

    const-string v4, "SGH-T959V"

    aput-object v4, v3, v2

    const/16 v2, 0xa

    const-string v4, "SCH-I500"

    aput-object v4, v3, v2

    const/16 v2, 0xb

    const-string v4, "SCH-I510"

    aput-object v4, v3, v2

    const/16 v2, 0xc

    const-string v4, "ADR6425LVW"

    aput-object v4, v3, v2

    const/16 v2, 0xd

    const-string v4, "MB865"

    aput-object v4, v3, v2

    const-string v2, "LT15a"

    aput-object v2, v3, v5

    const/16 v2, 0xf

    const-string v4, "PC36100"

    aput-object v4, v3, v2

    const/16 v2, 0x10

    const-string v4, "PG86100"

    aput-object v4, v3, v2

    const/16 v2, 0x11

    const-string v4, "GT-N7000"

    aput-object v4, v3, v2

    const/16 v2, 0x12

    const-string v4, "GT-P7510"

    aput-object v4, v3, v2

    const/16 v2, 0x13

    const-string v4, "ThinkPad Tablet"

    aput-object v4, v3, v2

    .line 293
    sget v2, Landroid/os/Build$VERSION;->SDK_INT:I

    if-lt v2, v5, :cond_1

    .line 305
    :cond_0
    :goto_0
    invoke-static {}, Lcom/instagram/m/a/b;->a()Lcom/instagram/m/a/b;

    move-result-object v1

    .line 306
    invoke-virtual {v1, v0}, Lcom/instagram/m/a/b;->b(Z)Z

    move-result v0

    .line 307
    invoke-virtual {v1, v0}, Lcom/instagram/m/a/b;->c(Z)Z

    .line 308
    return-void

    .line 297
    :cond_1
    array-length v4, v3

    move v2, v1

    :goto_1
    if-ge v2, v4, :cond_2

    aget-object v5, v3, v2

    .line 298
    sget-object v6, Landroid/os/Build;->MODEL:Ljava/lang/String;

    invoke-virtual {v5, v6}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v5

    if-nez v5, :cond_0

    .line 297
    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    :cond_2
    move v0, v1

    goto :goto_0
.end method

.method private h()V
    .locals 3

    .prologue
    .line 311
    const/4 v0, 0x0

    .line 312
    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v2, 0xe

    if-lt v1, v2, :cond_0

    .line 314
    const/4 v0, 0x1

    .line 317
    :cond_0
    invoke-static {}, Lcom/instagram/m/a/b;->a()Lcom/instagram/m/a/b;

    move-result-object v1

    .line 318
    invoke-virtual {v1, v0}, Lcom/instagram/m/a/b;->d(Z)Z

    move-result v0

    .line 319
    invoke-virtual {v1, v0}, Lcom/instagram/m/a/b;->e(Z)Z

    .line 320
    return-void
.end method


# virtual methods
.method public a()Landroid/location/Location;
    .locals 1

    .prologue
    .line 339
    iget-object v0, p0, Lcom/instagram/android/InstagramApplication;->c:Lcom/instagram/android/m/a;

    invoke-virtual {v0}, Lcom/instagram/android/m/a;->a()Landroid/location/Location;

    move-result-object v0

    return-object v0
.end method

.method public a(Ljava/util/Observer;)Lcom/instagram/android/m/a;
    .locals 3
    .parameter

    .prologue
    .line 323
    iget-object v0, p0, Lcom/instagram/android/InstagramApplication;->c:Lcom/instagram/android/m/a;

    invoke-virtual {v0, p1}, Lcom/instagram/android/m/a;->addObserver(Ljava/util/Observer;)V

    .line 324
    iget-object v1, p0, Lcom/instagram/android/InstagramApplication;->c:Lcom/instagram/android/m/a;

    const-string v0, "location"

    invoke-virtual {p0, v0}, Lcom/instagram/android/InstagramApplication;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/location/LocationManager;

    const/4 v2, 0x1

    invoke-virtual {v1, v0, v2}, Lcom/instagram/android/m/a;->a(Landroid/location/LocationManager;Z)V

    .line 326
    iget-object v0, p0, Lcom/instagram/android/InstagramApplication;->c:Lcom/instagram/android/m/a;

    return-object v0
.end method

.method public a(Landroid/location/Location;)Z
    .locals 1
    .parameter

    .prologue
    .line 335
    iget-object v0, p0, Lcom/instagram/android/InstagramApplication;->c:Lcom/instagram/android/m/a;

    invoke-virtual {v0, p1}, Lcom/instagram/android/m/a;->b(Landroid/location/Location;)Z

    move-result v0

    return v0
.end method

.method public b(Ljava/util/Observer;)V
    .locals 2
    .parameter

    .prologue
    .line 330
    iget-object v0, p0, Lcom/instagram/android/InstagramApplication;->c:Lcom/instagram/android/m/a;

    invoke-virtual {v0, p1}, Lcom/instagram/android/m/a;->deleteObserver(Ljava/util/Observer;)V

    .line 331
    iget-object v1, p0, Lcom/instagram/android/InstagramApplication;->c:Lcom/instagram/android/m/a;

    const-string v0, "location"

    invoke-virtual {p0, v0}, Lcom/instagram/android/InstagramApplication;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/location/LocationManager;

    invoke-virtual {v1, v0}, Lcom/instagram/android/m/a;->a(Landroid/location/LocationManager;)V

    .line 332
    return-void
.end method

.method public onCreate()V
    .locals 4

    .prologue
    .line 141
    invoke-super {p0}, Landroid/app/Application;->onCreate()V

    .line 142
    new-instance v0, Lcom/instagram/l/a;

    invoke-direct {v0}, Lcom/instagram/l/a;-><init>()V

    invoke-virtual {v0}, Lcom/instagram/l/a;->a()V

    .line 144
    invoke-static {p0}, Lcom/instagram/e/a/a;->a(Landroid/content/Context;)V

    .line 145
    invoke-virtual {p0}, Lcom/instagram/android/InstagramApplication;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    sget v1, Lcom/facebook/bb;->InstagramTheme:I

    invoke-virtual {v0, v1}, Landroid/content/Context;->setTheme(I)V

    .line 146
    invoke-static {p0}, Lcom/instagram/i/a;->a(Landroid/content/Context;)V

    .line 149
    invoke-static {}, Lcom/instagram/i/a;->d()Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x6

    :goto_0
    invoke-static {v0}, Lcom/facebook/e/a/a;->a(I)V

    .line 155
    invoke-static {p0}, Landroid/support/v4/a/e;->a(Landroid/content/Context;)Landroid/support/v4/a/e;

    move-result-object v0

    iget-object v1, p0, Lcom/instagram/android/InstagramApplication;->f:Landroid/content/BroadcastReceiver;

    new-instance v2, Landroid/content/IntentFilter;

    const-string v3, "AuthHelper.BROADCAST_USER_CHANGED"

    invoke-direct {v2, v3}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, v1, v2}, Landroid/support/v4/a/e;->a(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)V

    .line 159
    invoke-static {p0}, Lcom/instagram/g/a;->a(Landroid/app/Application;)V

    .line 160
    invoke-static {}, Lcom/instagram/i/a;->d()Z

    move-result v0

    if-nez v0, :cond_1

    const/4 v0, 0x1

    :goto_1
    invoke-static {v0}, Landroid/support/v4/app/aj;->a(Z)V

    .line 162
    invoke-static {p0}, Lcom/instagram/service/PersistentCookieStore;->a(Landroid/content/Context;)V

    .line 164
    invoke-static {p0}, Lcom/instagram/android/support/camera/d;->a(Landroid/content/Context;)V

    .line 166
    invoke-static {p0}, Lcom/instagram/m/a/b;->a(Landroid/content/Context;)V

    .line 167
    invoke-static {p0}, Lcom/instagram/android/o/f;->a(Landroid/content/Context;)V

    .line 170
    invoke-static {}, Lcom/instagram/service/a;->a()Lcom/instagram/service/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/service/a;->b()Lcom/instagram/android/model/b/e;

    .line 174
    invoke-static {}, Lcom/instagram/android/g/b;->e()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/instagram/g/a;->a(Ljava/lang/String;)V

    .line 176
    invoke-direct {p0}, Lcom/instagram/android/InstagramApplication;->d()V

    .line 178
    invoke-direct {p0}, Lcom/instagram/android/InstagramApplication;->c()V

    .line 181
    invoke-direct {p0}, Lcom/instagram/android/InstagramApplication;->f()V

    .line 183
    invoke-static {}, Lcom/instagram/camera/h;->a()V

    .line 184
    invoke-static {}, Lcom/instagram/android/model/b/e;->a()V

    .line 186
    invoke-static {p0}, Lcom/instagram/f/b/c;->a(Landroid/content/Context;)V

    .line 187
    invoke-static {}, Lcom/instagram/f/b/c;->a()Lcom/instagram/f/b/c;

    move-result-object v0

    sget-object v1, Lcom/instagram/android/InstagramApplication;->b:Lcom/instagram/f/b/h;

    invoke-virtual {v0, v1}, Lcom/instagram/f/b/c;->a(Lcom/instagram/f/b/h;)V

    .line 189
    invoke-static {p0}, Lcom/instagram/android/mediacache/n;->a(Landroid/content/Context;)V

    .line 191
    invoke-static {}, Lcom/instagram/pendingmedia/b/c;->a()Lcom/instagram/pendingmedia/b/c;

    .line 193
    invoke-direct {p0}, Lcom/instagram/android/InstagramApplication;->g()V

    .line 194
    invoke-direct {p0}, Lcom/instagram/android/InstagramApplication;->h()V

    .line 196
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    .line 200
    new-instance v1, Lcom/instagram/android/d;

    invoke-direct {v1, p0}, Lcom/instagram/android/d;-><init>(Lcom/instagram/android/InstagramApplication;)V

    const-wide/16 v2, 0x1770

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 211
    return-void

    .line 149
    :cond_0
    const/4 v0, 0x2

    goto :goto_0

    .line 160
    :cond_1
    const/4 v0, 0x0

    goto :goto_1
.end method

.method public onTerminate()V
    .locals 2

    .prologue
    .line 261
    invoke-super {p0}, Landroid/app/Application;->onTerminate()V

    .line 262
    invoke-static {p0}, Landroid/support/v4/a/e;->a(Landroid/content/Context;)Landroid/support/v4/a/e;

    move-result-object v0

    iget-object v1, p0, Lcom/instagram/android/InstagramApplication;->f:Landroid/content/BroadcastReceiver;

    invoke-virtual {v0, v1}, Landroid/support/v4/a/e;->a(Landroid/content/BroadcastReceiver;)V

    .line 263
    const/4 v0, 0x0

    invoke-static {v0}, Lcom/instagram/e/a/a;->a(Landroid/content/Context;)V

    .line 264
    return-void
.end method
